@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            

            <div class="card">
                <div class="card-header">{{ __('Edit') }}</div>

                <div class="card-body">
                    <form method="POST" action="{{ route('computers.update',['computer'=>$computer->id]) }}">
                        @csrf
                        @method('PUT')
                        <div class="form-group row">
                            <label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>

                            <div class="col-md-6">
                                <input id="name" type="text" disabled class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ $computer->name }}" required autofocus>
                            </div>
                        </div>

    					<div class="form-group row">
                            <label for="mac" class="col-md-4 col-form-label text-md-right">mac地址</label>

                            <div class="col-md-6">
                                <input id="mac" type="text" disabled class="form-control{{ $errors->has('mac') ? ' is-invalid' : '' }}" name="mac" value="{{ $computer->mac }}" required autofocus>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="people" class="col-md-4 col-form-label text-md-right">用户名</label>

                            <div class="col-md-6">
                                <input id="people" type="text" class="form-control{{ $errors->has('people') ? ' is-invalid' : '' }}" name="people" value="{{ $computer->people }}" autofocus>

                                @if ($errors->has('people'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('people') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="expiredDate" class="col-md-4 col-form-label text-md-right">到期时间</label>

                            <div class="col-md-6">
                                <input id="expiredDate" type="text" class="form-control{{ $errors->has('expiredDate') ? ' is-invalid' : '' }}" name="expiredDate" value="{{ $computer->expiredDate }}" autofocus>

                                @if ($errors->has('expiredDate'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('expiredDate') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="remote" class="col-md-4 col-form-label text-md-right">远程连接</label>

                            <div class="col-md-6">
                                <input id="remote" type="text" class="form-control{{ $errors->has('remote') ? ' is-invalid' : '' }}" name="remote" value="{{ $computer->remote }}" autofocus>

                                @if ($errors->has('remote'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('remote') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="remote_pass" class="col-md-4 col-form-label text-md-right">远程密码</label>

                            <div class="col-md-6">
                                <input id="remote_pass" type="text" class="form-control{{ $errors->has('remote_pass') ? ' is-invalid' : '' }}" name="remote_pass" value="{{ $computer->remote_pass }}" autofocus>

                                @if ($errors->has('remote_pass'))
                                    <span class="invalid-feedback">
                                        <strong>{{ $errors->first('remote_pass') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        

                        <div class="form-group row mb-0">
                            <div class="col-md-6 offset-md-4">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Edit') }}
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>




        </div>
    </div>
</div>
@endsection
